﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using Leafing.Data;
using Leafing.Data.Definition;
using Leafing.Core;

using Leafing.Web;
using Leafing.Core.Logging;
using Wz16.Baoming.BLL;

public partial class Login : PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (DbEntryMembershipUser.GetCount(Condition.Empty) == 0)
            {
                this.CreateUserWizard1.Visible = true;
                this.Login1.Visible = false;
            }
            else
            {
                this.CreateUserWizard1.Visible = false;
                this.Login1.Visible = true;
            }
        }
    }
    protected void Login1_LoginError(object sender, EventArgs e)
    {
        Logger.Default.Warn(string.Format("登录失败，用户：{0}",this.Login1.UserName));
    }
    protected void Login1_LoggedIn(object sender, EventArgs e)
    {
        Logger.Default.Warn(string.Format("登录成功，用户：{0}", this.Login1.UserName));
        Response.Redirect("frmList.aspx");
    }
}
